package com.zyf.chapter02.behavior.iterator.achieve;

/**
 * @author yifeng
 */
public class ArrayList<E> implements List<E> {

    @Override
    public Iterator iterator() {
        return new ArrayIterator(this);
    }

    @Override
    public int size() {
        return 0;
    }

    @Override
    public E get(int index) {
        return null;
    }

    @Override
    public E add(E e) {
        return null;
    }

    public static void main(String[] args) {
        ArrayList<String> names = new ArrayList<>();
        names.add("y");
        names.add("yf");
        names.add("zyf");

        Iterator<String> iterator = names.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.currentItem());
            iterator.next();
        }
    }


}
